import request from '@/utils/request';

/**
 * 获取解除劳动关系配置列表
 */
export const getSeverLaborSettingList = () =>
    request('/api/dimission/v1/settings/labors', {
        method: 'GET'
    });

/**
 * 编辑解除劳动关系配置
 */
export const handleHandoverFlowEdit = params =>
    request('/api/dimission/v1/settings/labors', {
        method: 'POST',
        data: params
    });

/**
 * 获取交接流程配置信息列表
 */
export const getHandoverFlowList = () =>
    request('/api/dimission/v1/settings/handovers', {
        method: 'GET'
    });

/**
 * 删除交接流程配置信息
 */
export const deleteHandoverFlowList = handoverId =>
    request(`/api/dimission/v1/settings/handovers/${handoverId}`, {
        method: 'DELETE'
    });

/**
 * 获取交接流程配置信息详情
 */
export const getHandoverFlowDetail = (handoverId, type) =>
    request(`/api/dimission/v1/settings/handovers/${handoverId}/${type}`, {
        method: 'GET'
    });


/**
 * 获取初始交接流程信息
 */
export const getHandoverFlowInitialDetail = () =>
    request('/api/dimission/v1/settings/handovers/initial_handover_processes', {
        method: 'GET'
    });

/**
 * 新增交接流程
 */
export const handleAddHandoverFlow = params =>
    request('/api/dimission/v1/settings/handovers', {
        method: 'POST',
        data: params
    });

/**
 * 暂存交接流程
 */
export const handleSaveHandoverFlow = params =>
    request('/api/dimission/v1/settings/handovers/temps', {
        method: 'POST',
        data: params
    });

/**
 * 获取离职证明模板列表
 */
export const getLeavingProveList = () =>
    request('/api/dimission/v1/settings/templates', {
        method: 'GET'
    });

/**
 * 删除离职证明模板
 */
export const deleteLeavingProve = templateId =>
    request(`/api/dimission/v1/settings/templates/${templateId}`, {
        method: 'DELETE'
    });

/**
 * 获取离职证明模板详情
 */
export const getLeavingProveDetail = templateId =>
    request(`/api/dimission/v1/settings/templates/${templateId}`, {
        method: 'GET'
    });

/**
 * 获取离职证明默认数据
 */
export const getLeavingProveDefaultConfig = templateType =>
    request(`/api/dimission/v1/settings/templates/defaults/${templateType}`, {
        method: 'GET'
    });

/**
 * 保存离职证明模板
 */
export const handleLeavingProve = params =>
    request('/api/dimission/v1/settings/templates', {
        method: 'POST',
        data: params
    });
